<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>注册新用户</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<link href="css/style.css" rel="stylesheet" type="text/css" />
  </head>
  
  <body>
   
<div class="header"> 
	<a href="http://email.163.com/"><img src="image/logo_netease.gif" alt="网易邮箱" class="logo" /></a>
	<div class="logo_w" title="中国第一大电子邮件服务商"></div>
    <div class="head_links"><!-- <a href="http://mail.163.com/" target="_blank" title="网易163免费邮">163</a>&nbsp;&nbsp;&nbsp;<a href="http://www.126.com/" target="_blank" title="网易126免费邮">126</a>&nbsp;&nbsp;&nbsp; --><a href="http://help.163.com/" target="_blank" title="帮助">&nbsp</a>&nbsp;&nbsp;&nbsp;</div>
</div>

<div class="content">
	<div class="mhd">
   
 </div>

    <div class="mcont">
        	
<div id="sysmessage" class="err-info" style="display:none"></div>
<input type="hidden" name="tmp" id="tmp" value="" />

<form  action="Zhuce.action" method="post" onsubmit="return check();">
        <div class="main-cont">
			<div class="main-cont-tit"><div class="arr"></div><h2>创建您的帐号</h2></div>
		
            <table class="cont-tab" cellspacing="0" cellpadding="0" style="table-layout:fixed">


<tr>
    <td class="td1">用户名：<span class="nes">*</span></td>
    <td class="td2">
		
			
 <input type="text" name="user" id="inp_uname" value="" class="inp ipt-normal" style="width:110px; font-weight:bold" maxlength="18" /><span><strong>@126.com</strong><input id="btn_chk" type="button" value="检测" class="btn-jc fri" onclick="getclass();"/></span>
			
		
	


	</td>
    <td class="td3"><strong><span id="username" style="color:red"></span></strong>
        <div class="info">
        	
            
          

            
         
            
        </div>
    </td>
  </tr>
  
 
<tr>
    <td class="td1">密　码：<span class="nes">*</span></td>
    <td class="td2"><input type="password" name="password" id="password" class="inp ipt-normal" maxlength="16" value="" /></td>
    <td class="td3"><span id="passwordSpan" style="color:red"></span>
        <div class="info">
        	
            
          
        </div>
    </td>
  </tr>
  <tr>
    <td class="td1">再次输入密码：<span class="nes">*</span></td>
    <td class="td2"><input type="password" name="passwordconfirm" id="passwordconfirm" class="inp ipt-normal" onFocus="this.className='inp ipt-focus'" maxlength="16" value=""/><!--输入框3种状态 “ipt-normal”-正常，“ipt-focus”-获取焦点，“ipt-error”-正常， --></td>
    <td class="td3"><span id="passwordconfirmSpan" style="color:red"></span>
        <div class="info">
		
          
        </div>
    </td>
  </tr>
</table>
			<div class="main-cont-tit"><div class="arr"></div><h2>安全信息设置</h2> <span class="fle Cgray">（以下信息非常重要，请慎重填写）</span></div>
		
            <table class="cont-tab" cellspacing="0" cellpadding="0" style="table-layout:fixed">
  <tr>
    <td class="td1">密码保护问题：<span class="nes">*</span></td>
    <td class="td2">
    	<select name="question" id="secproblem" class="sel" onchange="changeQuestion(this)">
    		<option style="color:#666" value="0">请选择密码提示问题</option>
    		<option value="您母亲的姓名是?">您母亲的姓名是?</option>
		  	<option value="您父亲的姓名是?">您父亲的姓名是?</option>
		  	<option value="您配偶的姓名是?">您配偶的姓名是?</option>
		  	<option value="您母亲的生日是?">您母亲的生日是?</option>
		  	<option value="您父亲的生日是?">您父亲的生日是?</option>
		  	<option value="您配偶的生日是?">您配偶的生日是?</option>
		 	<option value="您的出生地是?">您的出生地是?</option>
		  	<option value="您的小学校名是?">您的小学校名是?</option>
		  	<option value="您的中学校名是?">您的中学校名是?</option>
		  	<option value="您的大学校名是?">您的大学校名是?</option>
			
    	</select>
    	</td>
    <td class="td3"><span id="secproblemSpan" style="color:red"></span>
        <div class="info">
           
        </div>
    </td>
  </tr>
  <tr id="tr_cusproblem" style="display:none">
    <td class="td1">请输入自定义的问题：<span class="nes">*</span></td>
    <td class="td2">
		<input type="text" id="cusproblem" name="cusproblem" class="inp ipt-normal" onFocus="this.className='inp ipt-focus'" maxlength="36" /><!--输入框3种状态 “ipt-normal”-正常，“ipt-focus”-获取焦点，“ipt-error”-正常， -->
		</td>
    <td class="td3">
        <div class="info">
			

                       
        </div>
    </td>
  </tr>
  <tr>
    <td class="td1">密码保护问题答案：<span class="nes">*</span></td>
    <td class="td2">
		<input type="text" name="answer" id="secanswer" class="inp ipt-normal" onFocus="this.className='inp ipt-focus';"  maxlength="30" /><!--输入框3种状态 “ipt-normal”-正常，“ipt-focus”-获取焦点，“ipt-error”-正常， -->
		</td>
    <td class="td3"><span id="secanswerSpan" style="color:red"></span>
        <div class="info">
        
           
            
                       
        </div>
    </td>
  </tr>
 <tr>
    <td class="td1">性　别：<span class="nes">*</span></td>
    <td class="td2" style="font-size:14px"><label for="rd1"><input type="radio"  name="gender" id="rd1" value="男"  checked="checked"> 男</label>&nbsp;&nbsp;&nbsp;&nbsp;<label for="rd2"><input type="radio" name="gender" id="rd2" value="女" > 女</label></td>
    <td class="td3">
        <div class="info">
                        
        </div>
    </td>
  </tr>
  <tr>
    <td class="td1">出生日期：<span class="nes"></span></td>
    <td class="td2" style="font-size:14px">
		<input type="text" name="year" id="year" value="" class="inp ipt-normal" onFocus="this.className='inp ipt-focus'" maxlength="4" style="width:80px" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" /> 年 <input type="text" name="month" id="month" value="" class="inp ipt-normal" onFocus="this.className='inp ipt-focus'" maxlength="2" style="width:50px" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" /> 月 <input type="text" name="day" id="day" value="" class="inp ipt-normal" onFocus="this.className='inp ipt-focus'" maxlength="2" style="width:50px" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" /> 日
		</td>
    <td class="td3"><span id="yearSpan" style="color:red"></span>
        <div class="info">
            
			            
        </div>
    </td>
  </tr>
  <tr>
    <td class="td1">手机号：<span class="unnes">*</span></td>
    <td class="td2"><input type="text" name="mobile" id="mobile" value="" class="inp ipt-normal" onFocus="this.className='inp ipt-focus'" maxlength="16" /><!--输入框3种状态 “ipt-normal”-正常，“ipt-focus”-获取焦点，“ipt-error”-正常， --></td>
    <td class="td3"><span id="mobileSpan" style="color:red"></span>
        <div class="info">
			
			
        </div>
    </td>
  </tr>
</table>
			
		
           

			<div class="main-cont-tit"><div class="arr"></div><h2>服务条款</h2></div>
			<table class="cont-tab" cellspacing="0" cellpadding="0" style="table-layout:fixed">
  <tr>
    <td class="td1">&nbsp;</td>
    <td class="td2"><label>
    	<input type="checkbox" name="servItems" id="servItems" checked="true" >
    	我已阅读并接受</label>&ldquo;<a href="tiaokuan.jsp" target="_blank">服务条款</a>&rdquo;</td>
    <td class="td3">&nbsp;</td>
  </tr>
  <tr>
    <td class="td1">&nbsp;</td>
    <td class="td2"><input  type="submit" class="btn-submit" value="" title="创建帐号">
		</td>
    <td class="td3">&nbsp;</td>
  </tr>
</table>
       
        </div>
</form>
    	

    
    
    </div>
    <div class="mft"></div>
</div>



<div class="footer"><A href="http://corp.163.com/index_gb.html" target="_blank">关于网易</A>&nbsp;&nbsp;<A href="http://mail.blog.163.com/" target="_blank">邮箱官方博客</A>&nbsp;&nbsp;<A href="http://www.188.com/" target="_blank">财富邮</A>&nbsp;&nbsp;<A href="http://cards.163.com/" target="_blank">精美贺卡</A>&nbsp;&nbsp;<A href="http://safesurf.china.cn/data_form.php" target="_blank">举报违法信息</A>&nbsp;&nbsp;<A href="http://help.163.com/" target="_blank">客户服务</A><BR /><A href="http://corp.163.com/gb/legal/legal.html" target="_blank">相关法律</A>&nbsp;&nbsp;|&nbsp;&nbsp;网易公司版权所有&nbsp;&copy;&nbsp;1997-<script language="javascript" src="http://mimg.163.com/copyright/year.js"></script></div>

  </body>
</html>

  		<script type="text/javascript">
		var xmlhttp;
		function getXmlHttpRequest(){
			if (window.ActiveXObject) {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			else 
				if (window.XMLHttpRequest) {
				
					xmlhttp = new XMLHttpRequest();
				}
		}
		function getclass(){
			var user=document.getElementById("inp_uname").value;
if(user== ''){
document.getElementById('username').innerHTML = "用户名不能为空";
     return false;
}
 var patrn=/^([a-zA-Z0-9]|[._]){1,20}$/;
	 if(!patrn.exec(user))
		{
			document.getElementById('username').innerHTML ="输入1-20个以字母、数字、“_”、“.”的用户名";
			return false;
		}
			getXmlHttpRequest();
			name = document.getElementById("inp_uname").value;
        
             var url = encodeURI('lookuser.action?name='+name+'&r='+Math.random());
			xmlhttp.open("get",url,true);
			xmlhttp.onreadystatechange= updatePage;
			xmlhttp.send(null);
		}
		function updatePage(){
			if(xmlhttp.readyState==4){
				
				if(xmlhttp.status==200){
					document.getElementById("username").innerHTML=xmlhttp.responseText;
				}
			}
		}
	</script>
<script type="text/javascript">

function check(){
var user=document.getElementById("inp_uname").value;
if(user== ''){
document.getElementById('username').innerHTML = "用户名不能为空";
     return false;
}
if(document.getElementById('username').innerHTML== "用户名已用"){

     return false;
}

if(document.getElementById('username').innerHTML== ""){

	document.getElementById('username').innerHTML= "请检测用户名";
     return false;
}	
	  var patrn=/^([a-zA-Z0-9]|[._]){1,20}$/;
	 if(!patrn.exec(user))
		{
			document.getElementById('username').innerHTML ="输入1-20个以字母、数字、“_”、“.”的用户名";
			return false;
		}
 var password=document.getElementById("password").value;
 document.getElementById('passwordSpan').innerHTML = "";
if(password== '')
{
	document.getElementById('passwordSpan').innerHTML = "您的密码不能为空";
     return false;
 

}
var pz=/^(\w){1,20}$/; 

	if(!pz.exec(password))
		{
			document.getElementById('passwordSpan').innerHTML ="请输入1-20个包括字母、数字、下划线组合的密码";
			return false;
		}
		 document.getElementById('passwordconfirmSpan').innerHTML = "";
 var  passwordconfirm=document.getElementById("passwordconfirm").value;
if(passwordconfirm != password){
	document.getElementById('passwordconfirmSpan').innerHTML = "两次输入的密码不相等";
return false;

}
 document.getElementById('secproblemSpan').innerHTML = "";
 var  secanswer=document.getElementById("secproblem").value;
if(secanswer==0)
{
	document.getElementById('secproblemSpan').innerHTML = "还没选择问题";
     return false;
 

}


 document.getElementById('secanswerSpan').innerHTML = "";
  var  secanswer=document.getElementById("secanswer").value;
if(secanswer== '')
{
	document.getElementById('secanswerSpan').innerHTML = "答案不能为空";
     return false;
 

}
document.getElementById('yearSpan').innerHTML= "";
var year=document.getElementById("year").value;

if(year != ''){
if(year>2009||year==0){
document.getElementById('yearSpan').innerHTML = "日期格式不正确";
 return false;

}}

var month=document.getElementById("month").value;

if(month != ''){
if(month>12||month==0){
document.getElementById('yearSpan').innerHTML = "日期格式不正确";
 return false;

}}
var day=document.getElementById("day").value;

if(day != ''){
if(day>31||day==0){
document.getElementById('yearSpan').innerHTML = "日期格式不正确";
 return false;

}}
 document.getElementById('mobileSpan').innerHTML = "";
var reg = /^((\(\d{3}\))|(\d{3}\-))?13[0-9]\d{8}|15[0123589]\d{8}/;
	var mobile = document.getElementById('mobile').value;
	if(mobile != ''){
if(!reg.test(mobile)){
document.getElementById('mobileSpan').innerHTML = "手机格式不正确";
     return false;


}
}
var checked=false;
  var  servItems=document.getElementById('servItems');
 if(servItems.checked==true){
   checked = true; 
  return checked;

} if (!checked) 
    { 
        alert("请接受服务条款！"); 
        return  checked; 
    }
    
    }




</script>

	